package com;

/**
 * @author: Chenwujie
 * @date: 2021-08-03 16:53
 */
public class SynTest {
    private static boolean bool = true;
    private static int i = 1;


    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            while (bool) {
//                 System.out.println("11111111");
//                i = 1;
            }
            System.out.println("Thread0 - 结束");
        });
        t1.start();

        Thread.sleep(1000);
        bool = false;
        System.out.println("main - 结束");
    }
}
